<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateUserDimissionEvaluate extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_dimission_evaluate', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('userId')->default(0)->comment('用户ID');
            $table->unsignedInteger('shopId')->default(0)->comment('门店ID');
            $table->unsignedTinyInteger('score')->default(0)->comment('评分 1-非常不满意 2.3.4. 5-非常满意');
            $table->string('evaluateContent', 255)->default('')->comment('评价的内容');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('更新人');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');

            $table->index('userId', 'idx_userId');
            $table->index('shopId', 'idx_shopId');

            $table->comment = '用户门店离职评价';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_dimission_evaluate');
    }
}
